import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import 'antd/dist/reset.css'
import zhCN from 'antd/locale/zh_CN';
import { ConfigProvider } from 'antd'
import { BrowserRouter } from 'react-router-dom'
import { Provider } from 'react-redux';
import store from './store';

// 刷新时 侧边导航数组 重新过滤
import { filterMenu } from '@/store/slices/user' 
const role = localStorage.getItem('role');
if (role) {
  store.dispatch(filterMenu())
}
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
    <BrowserRouter>
      <ConfigProvider locale={zhCN}>
        <Provider store={store}>
         <App />
        </Provider>
      </ConfigProvider>
    </BrowserRouter>
)
